class Store {
    constructor() {
      this.state = {
        courses: [],
        events: [],
        currentClass: null
      };
      this.listeners = [];
    }
  
    setState(newState) {
      this.state = { ...this.state, ...newState };
      this.notify();
    }
  
    getState() {
      return this.state;
    }
  
    subscribe(listener) {
      this.listeners.push(listener);
      return () => {
        this.listeners = this.listeners.filter(l => l !== listener);
      };
    }
  
    notify() {
      this.listeners.forEach(listener => listener(this.state));
    }
  }
  
  const store = new Store();
  export default store;